home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Magazine / GraphicsCards / StormMesa / mklib.mits < prev    next >
Text File  |  1998-12-15  |  2KB  |  78 lines

  1. #!/bin/sh
  2.  
  3. # Make a Linux ELF shared for 3Dfx Glide with threading for MITS
  4.  
  5. #--identification------------------------------------------------------
  6.  
  7. # $Id: mklib.mits,v 1.1 1998/07/08 01:05:02 brianp Exp $
  8.  
  9. # $Log: mklib.mits,v $
  10. # Revision 1.1  1998/07/08 01:05:02  brianp
  11. # Initial revision
  12. #
  13.  
  14. #--common--------------------------------------------------------------
  15.  
  16. # Usage:  mklib libname major minor file.o ...
  17. #
  18. # First argument is name of output library (LIBRARY)
  19. # Second arg is major version number (MAJOR)
  20. # Third arg is minor version number (MINOR)
  21. # Rest of arguments are object files (OBJECTS)
  22.  
  23. LIBRARY=$1
  24. shift 1
  25.  
  26. MAJOR=$1
  27. shift 1
  28.  
  29. MINOR=$1
  30. shift 1
  31.  
  32. OBJECTS=$*
  33.  
  34. #--platform------------------------------------------------------------
  35.  
  36. # If we're making the libMesaGL.so file then also link in the Glide libs.
  37. # The -L/usr/i486-linux-libc5/lib option is specified so that licb5 is
  38. # used on RedHat 5.x systems.  This helps to fix Quake problems.  This
  39. # tip comes from Emil Briggs (briggs@tick.physics.ncsu.edu).  Thanks!
  40. if [ $LIBRARY = "libMesaGL.so" ] ; then
  41.     GLIDELIBS="-L/usr/local/glide/lib -lglide2x -L/usr/i486-linux-libc5/lib -lm -lpthread"
  42. fi
  43.  
  44.  
  45. # the following provided by Thomas Hiller (Hiller@tu-harburg.d400.de)
  46.  
  47. VERSION="${MAJOR}.${MINOR}"
  48.  
  49. LIBNAME=`basename $LIBRARY`
  50. ARNAME=`basename $LIBNAME .so`.a
  51. DIRNAME=`dirname $LIBRARY`
  52.  
  53. gcc -shared -Wl,-soname,${LIBNAME}.${MAJOR} -o ${LIBRARY}.${VERSION} ${OBJECTS} ${GLIDELIBS}
  54. (cd $DIRNAME; ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${MAJOR})
  55.  
  56. ln -s ${LIBNAME}.${MAJOR} ${LIBRARY}
  57.  
  58.  
  59. # also make regular .a files,
  60. # provided by Danek Duvall (duvall@dhduvall.student.princeton.edu)
  61.  
  62. ar ruv ${DIRNAME}/${ARNAME} ${OBJECTS}
  63. ranlib ${DIRNAME}/${ARNAME}
  64.  
  65.  
  66. # Print a reminder about shared libs:
  67. DIR=`cd .. ; pwd`
  68. echo
  69. echo "******Be sure to add" ${DIR}"/lib to your LD_LIBRARY_PATH variable"
  70. echo
  71. sleep 2
  72.  
  73.  
  74.  
  75. #### NOTES:
  76. # One Mesa user reports having to run the "ldconfig -v" command to make
  77. # Linux aware of the shared libs.
  78.